- Neovim-based IDE for R
- Parallel R with
batchtools
December 22, 2020
batchtoolsAnimated Screenshot of Nvim-R (from here):
srun --x11 --partition=short --mem=2gb --cpus-per-task 4 --ntasks 1 --time 1:00:00 --pty bash -l
Upload demo file to HPCC/biocluster:
wget https://raw.githubusercontent.com/ucr-hpcc/ucr-hpcc.github.io/master/_support_docs/tutorials/nvim_demo.R
z <- "dajfdfkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" z z z z z z z z z
data.frames is autmatically paged when including df_print: paged in preamble. In addition, one can set how many rows are shown on each page by assigning the desired number to the rows.print argument in the header of the corresponding code chunk (e.g. below it is set to 75 rows).x <- cbind(iris, iris[,5:1]) x
sbatchPrint information about queues/partitions available on a cluster.
sinfo
Compute jobs are submitted with sbatch via a submission script (here script_name.sh).
sbatch script_name.sh
Sample submission script
#!/bin/bash -l #SBATCH --nodes=1 #SBATCH --ntasks=1 #SBATCH --cpus-per-task=1 #SBATCH --mem-per-cpu=1G #SBATCH --time=1-00:15:00 # 1 day and 15 minutes #SBATCH --mail-user=useremail@address.com #SBATCH --mail-type=ALL #SBATCH --job-name="some_test" #SBATCH -p batch # Choose queue/parition from: intel, batch, highmem, gpu, short myscript.sh
Interactive session with specific resource requests
srun --x11 --partition=short --mem=2gb --cpus-per-task 4 --ntasks 1 --time 1:00:00 --pty bash -l
library(DT) datatable(iris)
'smaller: false' is used. You usually have it set to 'smaller: true''{.smaller}' at the end of a slide title{.flexbox .vcenter} option after the title of a slideThis can be useful to have a figure on the right and bullets describing it on the left.
library(dplyr); library(ggplot2); library(reshape2)
iris %>%
group_by(Species) %>%
summarize_all(mean) %>%
reshape2::melt(id.vars=c("Species"), variable.name = "Samples", value.name="Values") %>%
ggplot(aes(Samples, Values, fill = Species)) +
geom_bar(position="dodge", stat="identity")